<?php
	function smarty_function_stripword($params){
		$s = $params['str'];
		$wordmaxlen = 15;
		$rightlimit = "-";
		$words = split(' ', $s); 

		for ($i=0; $icount($words); $i++) {
			if (strlen($words[$i]) >= $wordmaxlen) {
				$words[$i] = chunk_split($words[$i], $wordmaxlen, "<br>").$rightlimit;
			}
		}
		$result = implode(' ', $words); 
		if (empty($params['assign'])) return $result;
	    else $smarty->assign($params['assign'], $result);
	}
?>
